home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / kerberos / pc / krb_libk.lha / Lib / KRB / TIMEODAY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-25  |  539 b   |  27 lines

  1. /************************************************
  2.      timeoday.c
  3.  
  4.      gettimeofday replacement
  5.      Note that it ignores the timezone parameter
  6.  
  7.      by Peter Tan
  8. ************************************************/
  9. #include <timeval.h>
  10. #include <sys\timeb.h>
  11.  
  12. int gettimeofday(struct timeval *tv, struct timezone *tz)
  13. {
  14.     struct timeb buf;
  15.     
  16.     ftime(&buf);
  17.     
  18.     if (tv) {
  19.         tv->tv_sec=buf.time;
  20.         tv->tv_usec=buf.millitm;
  21.     }
  22.     if (tz) {
  23.         tz->tz_minuteswest=buf.timezone;
  24.         tz->tz_dsttime=buf.dstflag;
  25.     }
  26.     return 0;
  27.     }